import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import index from '@/views/index.vue'
import userLogin from '@/views/login/userLogin.vue'
import userRegister from '@/views/user/register.vue'
import userManage from '@/views/admin/userManage.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: index,
  },
  {
    path: '/login/userLogin',
    name: 'userLogin',
    component: userLogin,
  },
  {
    path: '/user/register',
    name: 'userRegister',
    component: userRegister,
  },
  {
    path: '/admin/userManage',
    name: 'adminUserManage',
    component: userManage,
  },
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
})

export default router
